import 'package:flutter/material.dart';
import 'package:flutter_program/fragment_four/bean/SheBaiListBean.dart';
import 'package:flutter_program/fragment_four/view/FourFragmentPagerInformation.dart';
import 'package:flutter_program/fragment_four/view/FourRelultPager.dart';

class FourFragmentPager extends StatefulWidget {
  List<SheBaiListBean> mDataFouDate = new List();

  FourFragmentPager(this.mDataFouDate);

  @override
  _FourFragmentPagerState createState() =>
      _FourFragmentPagerState(this.mDataFouDate);
}

class _FourFragmentPagerState extends State<FourFragmentPager> {
  List<SheBaiListBean> mDataFouDate = new List();

  _FourFragmentPagerState(this.mDataFouDate);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: InkWell(
          onTap: () {
            Navigator.of(context).pop();
          }, //故障申请表
          child: Icon(
            Icons.chevron_left,
            size: 29.0,
            color: Colors.white,
          ),
        ),
        automaticallyImplyLeading: false,
        centerTitle: true,
        title: Text(
          "备件列表",
          style: TextStyle(fontSize: 16.0),
        ),
        actions: <Widget>[
          Center(
            child:Container(
            padding:new EdgeInsets.only(right:20.0),
            child:InkWell(onTap:(){
              //设备管理
              Navigator.of(context).push(new PageRouteBuilder(
                pageBuilder: (BuildContext context, _, __) {
                  return new  FourRelultPager();
                },
              ));
            },child:Text("筛选"),)
          ),),
        ],
      ),
      backgroundColor: Color(0xFFEEEEEE),
      body: new ListView.builder(itemBuilder: (content, index) {
        return InkWell(
          onTap: (){
            //设备管理
            Navigator.of(context).push(new PageRouteBuilder(
              pageBuilder: (BuildContext context, _, __) {
                return new  FourFragmentPagerInformation(mDataFouDate,index);
              },
            ));
          }
          ,child:Container(
          margin: new EdgeInsets.only(top: 5.0, bottom: 5.0),
          color: Colors.white,
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Container(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Container(
                      margin: new EdgeInsets.only(
                          left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
                      child: Text(mDataFouDate[index].name,style:TextStyle(color:Colors.blue,fontSize:16.0,fontWeight: FontWeight.w400),),
                    ),
                    Container(
                      margin: new EdgeInsets.only(
                          left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
                      child: Text("备件编号:" + mDataFouDate[index].number),
                    ),
                    Container(
                      margin: new EdgeInsets.only(
                          left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
                      child: Text("规格型号:" + mDataFouDate[index].specModels),
                    ),
                    Container(
                      margin: new EdgeInsets.only(
                          left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
                      child: Text("当前库存:" +
                          mDataFouDate[index].currRepertory.toString()),
                    ),
                  ],
                ),
              ),
              Image.asset(
                "images/mipmap-xhdpi-v4/gteq_icon_main_go.png",
                height: 15.0,
                width: 18.0,
              ),
            ],
          ),
        ),);
      }),
    );
  }
}
